package cxm.proj.sms;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import cxm.com.util.MyApplication;

public class DownloadBroadcastReceiver extends BroadcastReceiver {
	/*
	MainActivity mainActivity = null;
	public DownloadBroadcastReceiver(MainActivity activity) {
		this.mainActivity = activity;
	}
	*/
	
	@Override
    public void onReceive(Context arg0, Intent arg1) {
		AlertDialog.Builder builder = new AlertDialog.Builder(MyApplication.context);
    	builder.setTitle("Download");
    	// int status = this.mainActivity.myDownloader.queryDownloadStatus();
    	String msg = "empty";
        switch (getResultCode())
        {
            case Activity.RESULT_OK:
            	/*
            	new AlertDialog.Builder(MyApplication.context).setTitle("Download").setMessage(
    	    			"Status + " + this.mainActivity.myDownloader.queryDownloadStatus()).setPositiveButton("Yes", null).show();
    	    	*/
            	msg = "Download Complete";
                break;
            case Activity.RESULT_CANCELED:
            	msg = "Download Failed";
                break;
        }
        builder.setMessage(msg + "Status ");
        // builder.show();
        Log.d("InternetReceiver", "Receiver status " + msg);
    }
}
